package com.shux.usermanager.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.shux.common.dao.impl.BaseBeanDaoImpl;
import com.shux.usermanager.dao.ISysUserDao;
import com.shux.usermanager.entity.SysUser;
import com.shux.utils.page.PageData;

@Repository("sysUserDao")
public class SysUserDaoImpl extends BaseBeanDaoImpl<SysUser> implements ISysUserDao {
    private static final String workspaceName = "com.shux.usermanager.dao.SysUserMapper";
    @Override
    public String getWorkSpaceName() {
        return workspaceName;
    }
    @Override
    public SysUser getSysUserByUsername(PageData pageData) throws Exception {
        return this.findForObject("getSysUserByUserName", pageData);
    }
    @Override
    public void updateSysUser(SysUser sysUser) throws Exception {
        this.update("updateByPrimaryKeySelective", sysUser);
    }
    @Override
    public SysUser getUserAndRoleById(String userId) throws Exception {
        // TODO Auto-generated method stub
        Map<String,String> param = new HashMap<String,String>();
        param.put("userId", userId);
        return this.findForObject("getUserAndRoleById", param);
    }
    
    

}
